package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Set;

import org.testng.annotations.Test;

public class GroupRemovalTests extends TestBase {

	@Test
	public void testFirstGroupCanBeRemoved() throws Exception {
		Set<GroupObject> oldList = app.getGroupHelper().getGroups();
		
		app.getGroupHelper().deleteGroup(0);
		
		Set<GroupObject> newList = app.getGroupHelper().getGroups();
		
		verifyGroupRemoved(oldList, newList);
	}
	
	private void verifyGroupRemoved(Set<GroupObject> oldList, Set<GroupObject> newList) {
			
			if(newList.size() != 0) {
				assertThat(newList.size(), equalTo(oldList.size()-1));
			}
			
		}
}
